// 自定义异常类
package org.example.backend.exception;

public class BaseException extends RuntimeException {
    private int code;
    private long timestamp;

    public BaseException(String message) {
        super(message);
        this.timestamp = System.currentTimeMillis();
    }

    public BaseException(String message, int code) {
        super(message);
        this.code = code;
        this.timestamp = System.currentTimeMillis();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }
}
